<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:v-bind="http://www.w3.org/1999/xhtml"
      xmlns:v-on="http://www.w3.org/1999/xhtml">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <link th:href="@{/js/el/index.css}" rel="stylesheet"  type="text/css"/>
    <script th:src="@{/js/vue.js}" type="text/javascript"></script>
    <script th:src="@{/js/el/index.js}" type="text/javascript"></script>
    <script th:src="@{/js/axios.js}" type="text/javascript"></script>


</head>
<style>
    .t {
     background-color: #66b1ff;
    }
</style>
<body>
<div id="app">
    <div th:include= "~{common/head_fore::head}"></div>
    <div style="display: flex; width: 100%; height: 45vw">


        <div  style="width: 100vw; border: 1px solid #ffc0ff;">
            <table border="1px" style="width: 5vw">
                <th>作者</th>
                <th>时间</th>
                <th>标题</th>
                <th>摘要</th>
                <th>类型id</th>
                <th>操作</th>
                <tr v-for="b in book">
                    <td>{{b.uid}}}</td>
                    <td>{{b.time}}</td>
                    <td>{{b.title}}</td>
                    <td>{{b.matter}}</td>
                    <td>{{b.typeid}}</td>
                    <td><button v-on:click="del(b.id)">删除</button></td>
                </tr>
            </table>
        </div>
    </div>

</div>



</body>
<script>
    new Vue({
        el:"#app",
        data:{
            book:[]

        },
        methods:{
            del(id){
                axios.post("/api/fore/del/"+id).then(function (resp) {
                    console.log(resp.data);


                })
            }
        },
        mounted(){
            var than = this;
            axios.get("/api/blog/findByUid")
                .then(function (resp) {
                    than.book = resp.data.data;
                })
        }

    })
</script>
</html>
